package com.acme.task1;

public class Calculator {
	public static void main(String[] args) {
		if (args.length != 3) {
			System.out.println("Number of arguments mismatch");
			return;
		}
		double operand1 = 0;
		double operand2 = 0;
		try {
			operand1 = Double.parseDouble(args[0]);
			operand2 = Double.parseDouble(args[2]);
		}
		catch (Exception e) {
			System.out.println("parameters type mismatch");
			return;
		}
		
		if (args[1].length() != 1) {
			System.out.println("Operator type mismatch");
			return;
		}
		char Operator = args[1].charAt(0);
		
		if (Operator != '+' && Operator != '-' && Operator != '*' && Operator != '/') {
			System.out.println("Operator type mismatch");
			return;
		}
		
		switch (Operator) {
		case '+':
			System.out.println(operand1 + operand2);
			break;
		case '-':
			System.out.println(operand1 - operand2);
			break;
		case '*':
			System.out.println(operand1 * operand2);
			break;
		case '/':
			try {
				System.out.println(operand1 / operand2);
			} 
			catch (Exception e) {
				e.printStackTrace(System.out);
			}
			break;
		default:
			break;
		}

	}
}
